package com.cloudfun.campusshare.service;

import com.cloudfun.campusshare.common.constant.MsgStatus;
import com.cloudfun.campusshare.common.constant.MsgType;
import com.cloudfun.campusshare.common.model.vo.MessageVo;
import com.cloudfun.campusshare.common.response.BaseResult;
import com.cloudfun.campusshare.common.response.PageResult;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by Huqin on 2019/12/28
 */
public interface MessageService {

    /**
     * 创建消息
     *
     * @param bizId
     * @param from
     * @param to
     * @param msgType
     * @param subjectParams
     * @param contentParams
     */
    void create(String bizId, String from, String to, MsgType msgType, List<String> subjectParams, List<String> contentParams);

    /**
     * 分页查询
     *
     * @param value
     * @param status
     * @param msgType
     * @param pageable
     * @return
     */
    PageResult<MessageVo> search(String value, MsgStatus status, MsgType msgType, Pageable pageable);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    MessageVo messageDetail(String id);

    /**
     * 标记为已读
     *
     * @param ids
     */
    void markAsRead(List<String> ids);

    /**
     * 更新是否有效字段
     *
     * @param ids
     * @param enabled
     * @Return
     */
    BaseResult<?> updateEnabled(List<String> ids, Boolean enabled);
}
